package com.me.web.pubsub.config;


import com.me.web.pubsub.service.IMessagePublishService;
import com.me.web.pubsub.service.RedisPublishServiceImpl;
import com.me.web.pubsub.vo.YanfanConstant;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * mq集群配置
 *
 * @author gsb
 * @date 2022/10/10 8:27
 */
@Configuration
//是否开启集群，默认不开启
public class MqConfig {

    @Bean
    @ConditionalOnProperty(prefix = "cluster", name = "type", havingValue = YanfanConstant.MQTT.REDIS_CHANNEL, matchIfMissing = true)
    public IMessagePublishService redisChannelPublish() {
        return new RedisPublishServiceImpl();
    }



}
